<template>
  <div class="h100">
    <el-container class="h100">
      <el-header>Header</el-header>
      <el-container>
        <el-aside width="200px">
          <el-col :span="24">
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
            >
              <el-menu-item index="1">
                <span slot="title">
                  <router-link tag="span" to="/homes/crud">
                    增删改查
                  </router-link>
                </span>
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-aside>
        <el-main>
          <el-breadcrumb separator="/">
            <el-breadcrumb-item v-for="(item, index) in $route.path.split('/')" :key="index">
                <span >
                    {{ dictionary[item] }}
                </span>
            </el-breadcrumb-item>
          </el-breadcrumb>
          <div class="main">
              <router-view />
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import axios from "@/http";
import dictionary from '@/utils/dictionary'
export default {
  data() {
      return {
          dictionary
      }
  },
  created() {
    axios.get("/getUserInfo").then((res) => {
      console.log(res);
    });
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: rgb(84, 92, 100);
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  padding: 25px;
}

.main {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #eee;
    min-height: 600px;
}
</style>